<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" th:href="@{/static/layui-v2.6.13/layui/css/layui.css}"/>
    <script type="text/javascript" th:src="@{/static/js/jquery-1.9.1.min.js}"></script>
    <script type="text/javascript" th:src="@{/static/layui-v2.6.13/layui/layui.js}"></script>
    <style>
        .push_goods{
            margin-top:10px;
            margin-right:20px;
            margin-left:20px;
            margin-bottom:10px;
        }
    </style>
</head>
<body>
<div class="layui-container" style="border:1px solid; width:100%">
    <div  align="right" style="margin-top:10px;margin-bottom:10px;">
        <input type="text" placeholder="请输入商品名" id="name" class="layui-btn layui-btn-primary">
        <select  id="type" 	class="layui-btn layui-btn-primary">
            <option value="" selected="selected">商品类别</option>
            <option th:each="type:${goodstypes}" th:value="${type.type}">[[${type.name}]]</option>
        </select>
        <label class="layui-btn layui-btn-normal" onclick="find()" style="margin-right:50px;">
            <i class="layui-icon">&#xe615;</i>
        </label>
    </div>
    <div class="layui-row" align="center">
        <div style="font-size: larger;font-weight: bold;color: #FF5722;padding: 15px;" align="center">
            搜索结果
        </div>
        <div class="layui-panel layui-inline push_goods" th:each="goods:${goodlist}">
            <div th:onclick="sp([[${goods.id}]])">
                <div style="width: 100%;">
                    <img th:src="@{/static/img/{url}(url=${goods.url})}" width="200px" height="200px"/>
                </div>
                <div style="margin: 10px; width: 100%;">
                    <div class="layui-inline" align="left">
                        <span class="layui-font-20 layui-font-red" th:text="'￥：' + ${goods.price}"></span>
                    </div>
                    <p style="margin-top: 10px; font-weight: bold; color: #000000;" th:text="${goods.name}"></p>
                </div>
            </div>
        </div>
    </div>
</div>

</body>
<script>
    function sp(id){
        location.href='/shop/shopping/good?id='+id;
    }
    function find(){
        var name = $("#name").val();
        var type = $("#type").val();
        location.href='/shop/shopping/list?name='+name+'&type='+type;
    }
</script>
</html>